﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace CapstoneProjectAEReader.Entities.Models
{
    [Serializable()]
    public class EbookGroup : ISerializable
    {
        public EbookGroup() { }

        private int _groupid;

        public string Groupname
        {
            get { return _groupname; }
            set { _groupname = value; }
        }

        public int Groupid
        {
            get { return _groupid; }
            set { _groupid = value; }
        }

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        private string _groupname;
        private string _description;

        // Seralize
        public EbookGroup(SerializationInfo info, StreamingContext ctxt)
        {
            _groupid = (int)info.GetValue("Groupid", typeof(int));
            _groupname = (string)info.GetValue("Groupname", typeof(string));
            _description = (string)info.GetValue("Description", typeof(string));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("Groupid", _groupid);
            info.AddValue("Groupname", _groupname);
            info.AddValue("Description", _description);
        }
    }
}
